package com.hu.zhcc.shiro.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hu.zhcc.common.entity.Page;
import com.hu.zhcc.shiro.dao.RReporttouploadMapper;
import com.hu.zhcc.shiro.entity.bo.HMemberofthefile;
import com.hu.zhcc.shiro.entity.bo.RReporttoupload;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RReporttouploadServiceImpl implements RReporttouploadService {

    @Autowired
    private RReporttouploadMapper rReporttouploadMapper;

    @Override
    public int deleteByPrimaryKey(Integer rId) {
        return rReporttouploadMapper.deleteByPrimaryKey(rId);
    }

    @Override
    public int insertSelective(RReporttoupload record) {
        return rReporttouploadMapper.insertSelective(record);
    }

    @Override
    public RReporttoupload selectByPrimaryKey(Integer rId) {
        return rReporttouploadMapper.selectByPrimaryKey(rId);
    }

    @Override
    public int updateByPrimaryKeySelective(RReporttoupload record) {
        return rReporttouploadMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public Page<RReporttoupload> findRrList(int pageIndex, int num) {
        PageHelper.startPage(pageIndex,num);
        List<RReporttoupload> hmList = rReporttouploadMapper.selectByPrimaryName();
        PageInfo<RReporttoupload> pageInfo = new PageInfo<>(hmList);
        return new Page<RReporttoupload>(pageInfo.getTotal(),hmList);
    }
}
